package com.brooks.demo;

/**
 * @author Maoyan
 * @data 2020/10/18 15:47
 * @Version 1.0.0
 */
public class TreadDaemon {
    public static void main(String[] args) {
        God god = new God();
        Man man = new Man();
        Thread thread = new Thread(god);
        thread.setDaemon(true);
        thread.start();

        new Thread(man).start();
    }
}

class God implements Runnable{

    @Override
    public void run() {
        while (true) {
            System.out.println("上帝守护着你");
        }

    }
}

class Man implements Runnable{

    @Override
    public void run() {
        for (int i = 0; i < 36655; i++) {
            System.out.println("你或者"+i);
        }
        System.out.println("======good bay======");
    }
}
